import 'package:wanxiang_app/generated/json/base/json_field.dart';
import 'package:wanxiang_app/generated/json/goods_detail_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class GoodsDetailEntity {
	late int code;
	late String msg;
	 GoodsDetailData data = GoodsDetailData();

	GoodsDetailEntity();

	factory GoodsDetailEntity.fromJson(Map<String, dynamic> json) => $GoodsDetailEntityFromJson(json);

	Map<String, dynamic> toJson() => $GoodsDetailEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class GoodsDetailData {
	late int id;
	@JSONField(name: "is_self")
	late int isSelf;
	@JSONField(name: "img_url")
	late String imgUrl;
	@JSONField(name: "add_time")
	late String addTime;
	late String title;
	late String content;
	@JSONField(name: "category_text")
	late String categoryText;
	@JSONField(name: "sell_price")
	late String sellPrice;
	@JSONField(name: "is_msg")
	late int isMsg;
	@JSONField(name: "is_indulge")
	late int isIndulge;
	@JSONField(name: "is_shoucang")
	late bool isShoucang;
	@JSONField(name: "channel_name")
	late String channelName;
	@JSONField(name: "channel_id")
	late String channelId;

	@JSONField(name: "is_deductible")
	late String isDeductible;

	@JSONField(name: "category_id")
	late String categoryId;
	@JSONField(name: "phone_number")
	late String phoneNumber;
	@JSONField(name: "wx_number")
	late String wxNumber;
	@JSONField(name: "qq_number")
	late String qqNumber;
	@JSONField(name: "account_source")
	late String accountSource;
	@JSONField(name: "is_bargain")
	late String isBargain;
	@JSONField(name: "game_account")
	late String gameAccount;
	late String fields;
	late List<GoodsDetailDataAlbums> albums;



	@JSONField(name: "role_text")
	 String roleText="";

	@JSONField(name: "good_guid")
	late String goodGuid;

	@JSONField(name: "good_name")
	late String goodName;
	late int status;

	@JSONField(name: "sx_price")
	late String sxPrice;

	GoodsDetailData();

	factory GoodsDetailData.fromJson(Map<String, dynamic> json) => $GoodsDetailDataFromJson(json);

	Map<String, dynamic> toJson() => $GoodsDetailDataToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class GoodsDetailDataAlbums {
	late int id;
	@JSONField(name: "original_path")
	late String originalPath;

	GoodsDetailDataAlbums();

	factory GoodsDetailDataAlbums.fromJson(Map<String, dynamic> json) => $GoodsDetailDataAlbumsFromJson(json);

	Map<String, dynamic> toJson() => $GoodsDetailDataAlbumsToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}